package tmhm.shemes;


import java.awt.Point;
import java.util.ArrayList;

import tmhm.components.*;
import tmhm.gui.GuiLabel;
import tmhm.gui.GuiLine;
import tmhm.gui.GuiScheme;


public class Exec1 {

    private static TSB TSBALUout1, TSBABout3;
    private static IntToInt ABLToAB, IBUS2ToALU, IBUS3ToALU;
    private static ALU ALUexec;
    private static IntToBools ALUbits, ABbits, BBbits;
    private static IntToInt IBUS1ToABandBB;
    private static TSB TSBBBout2;
    private static REG AB, BB;
    private static MP MX3, MX4;
    private static CD CD1, CD2;
    private static TSB TSBAWHout3, TSBAWout3, TSBBWout2;
    private static IntToInt AWToAWH;
    private static REG AW, BW;
    private static GuiScheme gui;

    public static GuiScheme getGui() {
        return gui;
    }

    public static void init() {

        TSBALUout1 = new TSB();
        TSBALUout1.getOut(0).setNumOfLines(8);

        ABLToAB = new IntToInt(8, 16, false, false);
        TSBABout3 = new TSB();
        TSBABout3.getOut(0).setNumOfLines(16);

        ALUexec = new ALU();
        ALUbits = new IntToBools(8, 8);
        ABbits = new IntToBools(8, 8);
        BBbits = new IntToBools(8, 8);

        IBUS1ToABandBB = new IntToInt(16, 8, false, false);
        IBUS2ToALU = new IntToInt(16, 8, false, false);
        IBUS3ToALU = new IntToInt(16, 8, false, false);
        TSBBBout2 = new TSB();
        TSBBBout2.getOut(0).setNumOfLines(8);

        AB = new REG(1, "AB");
        AB.getOut(0).setIsInt();
        AB.getOut(0).setNumOfLines(8);

        BB = new REG(1, "BB");
        BB.getOut(0).setIsInt();
        BB.getOut(0).setNumOfLines(8);

        MX3 = new MP(4);
        CD1 = new CD(4);
        CD1.setE(new Pin(true));

        MX4 = new MP(4);
        CD2 = new CD(4);
        CD2.setE(new Pin(true));

        TSBBWout2 = new TSB();
        TSBBWout2.getOut(0).setNumOfLines(16);

        AWToAWH = new IntToInt(16, 8, true, false);//izmena ***************************************
        TSBAWHout3 = new TSB();
        TSBAWHout3.getOut(0).setNumOfLines(8);

        TSBAWout3 = new TSB();
        TSBAWout3.getOut(0).setNumOfLines(16);

        AW = new REG(1, "AW");
        AW.getOut(0).setIsInt();
        AW.getOut(0).setNumOfLines(16);
        BW = new REG(1, "BW");
        BW.getOut(0).setIsInt();
        BW.getOut(0).setNumOfLines(16);

    }

    public static void connect() {

        TSBALUout1.setInputPin(0, ALUexec.getOut(0));
        TSBALUout1.setCtrl(Oper1.ALUout1());
        Bus1.addOnIBUS1(TSBALUout1.getOut(0));

        ABLToAB.setInputPin(0, AB.getOut(0));
        TSBABout3.setInputPin(0, ABLToAB.getOut(0));
        TSBABout3.setCtrl(Oper1.ABout3());
        Bus1.addOnIBUS3(TSBABout3.getOut(0));

        IBUS2ToALU.setInputPin(0, Bus1.IBUS2());
        IBUS3ToALU.setInputPin(0, Bus1.IBUS3());
        
        ALUexec.setPinX(IBUS3ToALU.getOut(0));
        ALUexec.setPinY(IBUS2ToALU.getOut(0));
        
        ALUexec.setPinAdd(Oper1.add());
        ALUexec.setPinSub(Oper1.sub());
        ALUexec.setPinInc(Oper1.inc());
        ALUexec.setPinDec(Oper1.dec());
        ALUexec.setPinAnd(Oper1.and());
        ALUexec.setPinOr(Oper1.or());
        ALUexec.setPinXor(Oper1.xor());
        ALUexec.setPinNot(Oper1.not());
        ALUbits.setInputPin(0, ALUexec.getOut(0));

        IBUS1ToABandBB.setInputPin(0, Bus1.IBUS1());

        TSBBBout2.setInputPin(0, BB.getOut(0));
        TSBBBout2.setCtrl(Oper1.BBout2());
        Bus1.addOnIBUS2(TSBBBout2.getOut(0));

        AB.setInputPin(0, IBUS1ToABandBB.getOut(0));
        AB.setPinLd(Oper1.ldAB());
        AB.setShr(Oper1.shr());
        AB.setIR(MX3.getOut(0));
        AB.setShl(Oper1.shl());
        AB.setIL(MX4.getOut(0));
        ABbits.setInputPin(0, AB.getOut(0));

        BB.setInputPin(0, IBUS1ToABandBB.getOut(0));
        BB.setPinLd(Oper1.ldBB());
        BBbits.setInputPin(0, BB.getOut(0));

        CD1.setInputPin(0, Fetch2.ASR());
        CD1.setInputPin(1, Fetch2.LSR());
        CD1.setInputPin(2, Fetch2.ROR());
        CD1.setInputPin(3, Fetch2.RORC());
        MX3.setCtrl(0, CD1.getOut(0));
        MX3.setCtrl(1, CD1.getOut(1));
        MX3.setInputPin(0, ABbits.getOut(7));
        MX3.setInputPin(1, new Pin(false));
        MX3.setInputPin(2, ABbits.getOut(0));
        MX3.setInputPin(3, Exec2.PSWC());

        CD2.setInputPin(0, Fetch2.ASL());
        CD2.setInputPin(1, Fetch2.LSL());
        CD2.setInputPin(2, Fetch2.ROL());
        CD2.setInputPin(3, Fetch2.ROLC());
        MX4.setCtrl(0, CD2.getOut(0));
        MX4.setCtrl(1, CD2.getOut(1));
        MX4.setInputPin(0, new Pin(false));
        MX4.setInputPin(1, new Pin(false));
        MX4.setInputPin(2, ABbits.getOut(7));
        MX4.setInputPin(3, Exec2.PSWC());

       TSBBWout2.setInputPin(0, BW.getOut(0));
        TSBBWout2.setCtrl(Oper1.BWout2());
        Bus1.addOnIBUS2(TSBBWout2.getOut(0));

        AWToAWH.setInputPin(0, AW.getOut(0));
        TSBAWHout3.setInputPin(0, AWToAWH.getOut(0));
        TSBAWHout3.setCtrl(Oper1.AWHout3());
        Bus1.addOnIBUS3(TSBAWHout3.getOut(0));

        TSBAWout3.setInputPin(0, AW.getOut(0));
        TSBAWout3.setCtrl(Oper1.AWout3());
        Bus1.addOnIBUS3(TSBAWout3.getOut(0));

        AW.setInputPin(0, Bus1.IBUS2());
        AW.setPinLd(Oper1.ldAW());
        BW.setInputPin(0, Bus1.IBUS2());
        BW.setPinLd(Oper1.ldBW());
    }

    public static void gui() {
        GuiLine line; // Pomocna promenljiva
        gui = new GuiScheme("tmhm/tmhm/images/Exec1.png");

        ArrayList<ArrayList<Point>> sections;
        ArrayList<Point> points;



sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(627,16));
points.add(new Point(627,832));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS1());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(608,31));
points.add(new Point(608,817));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS2());
gui.addLine(line);


sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(608,772));
points.add(new Point(175,772));
points.add(new Point(175,753));
sections.add(points);
points=new ArrayList<Point>();
points.add(new Point(401,772));
points.add(new Point(401,753));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS2());
gui.addLine(line);


sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(589,46));
points.add(new Point(589,801));
sections.add(points);
line=new GuiLine(sections,Bus1.IBUS3());
gui.addLine(line);


        BoolsToInt zeroes = new BoolsToInt(8, 8);
        for (int i = 0; i < 7; i++) {
            zeroes.setInputPin(i, new Pin(false));
        }


sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(341,63));
points.add(new Point(366,63));
sections.add(points);
line=new GuiLine(sections,zeroes.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(341,78));
points.add(new Point(366,78));
sections.add(points);
line=new GuiLine(sections,AB.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(404,70));
points.add(new Point(476,70));
sections.add(points);
line=new GuiLine(sections,ABLToAB.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(487,75));
points.add(new Point(487,81));
sections.add(points);
line=new GuiLine(sections,Oper1.ABout3());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(498,70));
points.add(new Point(589,70));
sections.add(points);
line=new GuiLine(sections,TSBABout3.getOut(0));
gui.addLine(line);




sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(140,632));
points.add(new Point(147,632));
sections.add(points);
line=new GuiLine(sections,Fetch2.ASR());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(140,614));
points.add(new Point(147,614));
sections.add(points);
line=new GuiLine(sections,Fetch2.LSR());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(140,595));
points.add(new Point(147,595));
sections.add(points);
line=new GuiLine(sections,Fetch2.ROR());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(139,576));
points.add(new Point(147,576));
sections.add(points);
line=new GuiLine(sections,Fetch2.RORC());
gui.addLine(line);



sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(203,614));
points.add(new Point(222,614));
points.add(new Point(222,538));
points.add(new Point(185,538));
points.add(new Point(185,529));
sections.add(points);
line=new GuiLine(sections,CD1.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(203,595));
points.add(new Point(213,595));
points.add(new Point(213,548));
points.add(new Point(166,548));
points.add(new Point(166,529));
sections.add(points);
line=new GuiLine(sections,CD1.getOut(1));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(140,510));
points.add(new Point(147,510));
sections.add(points);
line=new GuiLine(sections,Exec1.AB7());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(139,491));
points.add(new Point(147,491));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(139,472));
points.add(new Point(147,472));
sections.add(points);
line=new GuiLine(sections,Exec1.AB0());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(140,453));
points.add(new Point(147,453));
sections.add(points);
line=new GuiLine(sections,Exec2.PSWC());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(203,481));
points.add(new Point(222,481));
points.add(new Point(222,415));
points.add(new Point(92,415));
points.add(new Point(92,368));
points.add(new Point(100,368));
sections.add(points);
line=new GuiLine(sections,MX3.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(300,632));
points.add(new Point(307,632));
sections.add(points);
line=new GuiLine(sections,Fetch2.ASL());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(300,614));
points.add(new Point(307,614));
sections.add(points);
line=new GuiLine(sections,Fetch2.LSL());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(300,595));
points.add(new Point(307,595));
sections.add(points);
line=new GuiLine(sections,Fetch2.ROL());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(299,576));
points.add(new Point(307,576));
sections.add(points);
line=new GuiLine(sections,Fetch2.ROLC());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(363,614));
points.add(new Point(382,614));
points.add(new Point(382,538));
points.add(new Point(344,538));
points.add(new Point(344,529));
sections.add(points);
line=new GuiLine(sections,CD2.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(363,595));
points.add(new Point(373,595));
points.add(new Point(373,548));
points.add(new Point(326,548));
points.add(new Point(326,529));
sections.add(points);
line=new GuiLine(sections,CD2.getOut(1));
gui.addLine(line);



sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(300,510));
points.add(new Point(307,510));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(299,491));
points.add(new Point(307,491));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(299,472));
points.add(new Point(307,472));
sections.add(points);
line=new GuiLine(sections,Exec1.AB7());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(300,453));
points.add(new Point(307,453));
sections.add(points);
line=new GuiLine(sections,Exec2.PSWC());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(363,481));
points.add(new Point(382,481));
points.add(new Point(382,415));
points.add(new Point(258,415));
points.add(new Point(258,368));
points.add(new Point(250,368));
sections.add(points);
line=new GuiLine(sections,MX4.getOut(0));
gui.addLine(line);



sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(93,346));
points.add(new Point(100,346));
sections.add(points);
line=new GuiLine(sections,LogicalComponent.getCPUCLK());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(92,357));
points.add(new Point(100,357));
sections.add(points);
line=new GuiLine(sections,Oper1.shr());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(250,357));
points.add(new Point(257,357));
sections.add(points);
line=new GuiLine(sections,Oper1.shl());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(250,346));
points.add(new Point(257,346));
sections.add(points);
line=new GuiLine(sections,Oper1.ldAB());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(627,397));
points.add(new Point(175,397));
points.add(new Point(175,378));
sections.add(points);
line=new GuiLine(sections,IBUS1ToABandBB.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(175,336));
points.add(new Point(175,323));
sections.add(points);
line=new GuiLine(sections,AB.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(207,166));
points.add(new Point(215,166));
sections.add(points);
line=new GuiLine(sections,Oper1.not());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(208,181));
points.add(new Point(215,181));
sections.add(points);
line=new GuiLine(sections,Oper1.xor());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(208,197));
points.add(new Point(215,197));
sections.add(points);
line=new GuiLine(sections,Oper1.or());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(207,212));
points.add(new Point(215,212));
sections.add(points);
line=new GuiLine(sections,Oper1.and());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(211,242));
points.add(new Point(230,242));
points.add(new Point(230,231));
sections.add(points);
line=new GuiLine(sections,new Pin(false));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(608,246));
points.add(new Point(324,246));
points.add(new Point(324,231));
sections.add(points);
line=new GuiLine(sections,IBUS2ToALU.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(361,212));
points.add(new Point(368,212));
sections.add(points);
line=new GuiLine(sections,Oper1.add());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(361,197));
points.add(new Point(368,197));
sections.add(points);
line=new GuiLine(sections,Oper1.sub());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(361,181));
points.add(new Point(368,181));
sections.add(points);
line=new GuiLine(sections,Oper1.inc());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(361,166));
points.add(new Point(368,166));
sections.add(points);
line=new GuiLine(sections,Oper1.dec());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(368,132));
points.add(new Point(346,132));
points.add(new Point(346,148));
sections.add(points);
line=new GuiLine(sections,Exec1.C8());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(288,148));
points.add(new Point(288,117));
points.add(new Point(476,117));
sections.add(points);
line=new GuiLine(sections,ALUexec.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(487,123));
points.add(new Point(487,128));
sections.add(points);
line=new GuiLine(sections,Oper1.ALUout1());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(498,117));
points.add(new Point(627,117));
sections.add(points);
line=new GuiLine(sections,TSBALUout1.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(589,265));
points.add(new Point(252,265));
points.add(new Point(252,231));
sections.add(points);
line=new GuiLine(sections,IBUS3ToALU.getOut(0));
gui.addLine(line);




sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(401,397));
points.add(new Point(401,378));
sections.add(points);
line=new GuiLine(sections,IBUS1ToABandBB.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(318,357));
points.add(new Point(326,357));
sections.add(points);
line=new GuiLine(sections,LogicalComponent.getCPUCLK());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(476,357));
points.add(new Point(483,357));
sections.add(points);
line=new GuiLine(sections,Oper1.ldBB());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(401,337));
points.add(new Point(401,293));
points.add(new Point(476,293));
sections.add(points);
line=new GuiLine(sections,BB.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(487,298));
points.add(new Point(487,304));
sections.add(points);
line=new GuiLine(sections,Oper1.BBout2());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(498,293));
points.add(new Point(608,293));
sections.add(points);
line=new GuiLine(sections,TSBBBout2.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(93,732));
points.add(new Point(100,732));
sections.add(points);
line=new GuiLine(sections,Oper1.ldAW());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(250,732));
points.add(new Point(257,732));
sections.add(points);
line=new GuiLine(sections,LogicalComponent.getCPUCLK());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(175,712));
points.add(new Point(175,693));
sections.add(points);
line=new GuiLine(sections,AW.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(319,732));
points.add(new Point(326,732));
sections.add(points);
line=new GuiLine(sections,Oper1.ldBW());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(476,732));
points.add(new Point(483,732));
sections.add(points);
line=new GuiLine(sections,LogicalComponent.getCPUCLK());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(401,712));
points.add(new Point(401,670));
points.add(new Point(476,670));
sections.add(points);
line=new GuiLine(sections,BW.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(487,681));
points.add(new Point(487,675));
sections.add(points);
line=new GuiLine(sections,Oper1.BWout2());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(498,670));
points.add(new Point(608,670));
sections.add(points);
line=new GuiLine(sections,TSBBWout2.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(410,623));
points.add(new Point(476,623));
sections.add(points);
line=new GuiLine(sections,AW.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(429,623));
points.add(new Point(429,576));
points.add(new Point(476,576));
sections.add(points);
line=new GuiLine(sections, AWToAWH.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(487,581));
points.add(new Point(487,587));
sections.add(points);
line=new GuiLine(sections,Oper1.AWHout3());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(487,628));
points.add(new Point(487,634));
sections.add(points);
line=new GuiLine(sections,Oper1.AWout3());
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(498,576));
points.add(new Point(589,576));
sections.add(points);
line=new GuiLine(sections,TSBAWHout3.getOut(0));
gui.addLine(line);
sections=new ArrayList<ArrayList<Point>>();
points=new ArrayList<Point>();
points.add(new Point(498,623));
points.add(new Point(589,623));
sections.add(points);
line=new GuiLine(sections,TSBAWout3.getOut(0));
gui.addLine(line);



        // LABELE:
        gui.addLabel(new GuiLabel(631, 64, Bus1.IBUS1()));
        gui.addLabel(new GuiLabel(613, 80, Bus1.IBUS2()));
        gui.addLabel(new GuiLabel(593, 94, Bus1.IBUS3()));
        gui.addLabel(new GuiLabel(497, 393, IBUS1ToABandBB.getOut(0)));
        gui.addLabel(new GuiLabel(405, 316, BB.getOut(0)));
        gui.addLabel(new GuiLabel(526, 309, TSBBBout2.getOut(0)));
        gui.addLabel(new GuiLabel(169, 316, AB.getOut(0)));
        gui.addLabel(new GuiLabel(413, 241, IBUS2ToALU.getOut(0)));
        gui.addLabel(new GuiLabel(280, 260, IBUS3ToALU.getOut(0)));
        gui.addLabel(new GuiLabel(312, 112, ALUexec.getOut(0)));
        gui.addLabel(new GuiLabel(526, 129, TSBALUout1.getOut(0)));
        gui.addLabel(new GuiLabel(536, 84, TSBABout3.getOut(0)));
        gui.addLabel(new GuiLabel(164, 690, AW.getOut(0)));
        gui.addLabel(new GuiLabel(536, 589, TSBAWHout3.getOut(0)));
        gui.addLabel(new GuiLabel(582, 636, TSBAWout3.getOut(0)));
        gui.addLabel(new GuiLabel(84, 684, TSBBWout2.getOut(0)));
        gui.addLabel(new GuiLabel(500, 767, Bus1.IBUS2()));
        gui.addLabel(new GuiLabel(406, 691, BW.getOut(0)));
        gui.addLabel(new GuiLabel(196, 767, Bus1.IBUS2()));
    }

    public static Pin AB0() {
        return ABbits.getOut(0);
    }

    public static Pin AB1() {
        return ABbits.getOut(1);
    }

    public static Pin AB2() {
        return ABbits.getOut(2);
    }

    public static Pin AB3() {
        return ABbits.getOut(3);
    }

    public static Pin AB4() {
        return ABbits.getOut(4);
    }

    public static Pin AB5() {
        return ABbits.getOut(5);
    }

    public static Pin AB6() {
        return ABbits.getOut(6);
    }

    public static Pin AB7() {
        return ABbits.getOut(7);
    }

    public static Pin C8() {
        return ALUexec.getPinC8();
    }

    public static Pin ALU7() {
        return ALUbits.getOut(7);
    }

    public static Pin BB7() {
        return BBbits.getOut(7);
    }

    public static Pin AB() {
        return AB.getOut(0);
    }

    public static Pin BB() {
        return BB.getOut(0);
    }

    public static Pin ALU() {
        return ALUexec.getOut(0);
    }

    public static Pin BW() {
        return BW.getOut(0);
    }

    public static Pin AW() {
        return AW.getOut(0);
    }

    public static REG RegAB() {
        return AB;
    }

    public static REG RegBB() {
        return BB;
    }

    public static REG RegAW() {
        return AW;
    }

    public static REG RegBW() {
        return BW;
    }
}
